package com.bw.z.mvp.model.entity;

import com.google.gson.Gson;

import org.json.JSONArray;
import org.json.JSONException;

import java.util.ArrayList;
import java.util.List;

public class LiveCommentEntity extends BaseEntity {
    public String values;

    public List<Values> getValues() {
        List<Values> list = new ArrayList<>();
        if (values == null)
            return null;
        try {
            JSONArray jay = new JSONArray(values);
            for (int i = 0; i < jay.length(); i++) {
                String str = jay.getString(i);
                Values entity = new Gson().fromJson(str, Values.class);
                list.add(entity);
            }
        } catch (JSONException e) {
            e.printStackTrace();
        }

        return list;
    }

    /**
     * {\"comment_time\":0,\"live_id\":1,\"lc_id\":1,
     * \"user_id\":1,\"comment_value\":\"string\",
     * \"user_name\":\"zxy\",\"user_img\":\"IMG_20210524_230304.jpg\"}]
     */
    public static class Values {
        public long comment_time;
        public long live_id;
        public long lc_id;
        public long user_id;
        public String comment_value;
        public String user_name;
        public String user_img;
    }

}
